The development of computers in recent years has been accompanied by wider use of applications in which various documents and images are processed by computer. An inexpensive, high-performance apparatus not only for industrial use but for home use as well is being sought for devices such as digital cameras and printers that serve as input/output devices for inputting/outputting image information when image information is handled by such a computer. The proliferation of so-called multimedia has led to an improvement in image definition which, in turn, has been accompanied by a great increase in the quantity of image data handled by apparatus of the kind mentioned above.
FIGS. 19A and 19B are block diagram illustrating the construction of an image processing apparatus such as a digital camera or printer. FIG. 19A shows the overall construction of the apparatus, in which image data of an image that is to be output is applied to an image input unit 1, which proceeds to output the image data in raster-scan order to an image encoder 2. The image data is compressed and encoded by the image encoder 2 to obtain a code stream that is stored temporarily in a memory 3. The code stream that has been stored in the memory 3 is output to an image decoder 4, which decodes the code to a digital image data representing the original image. The digital image data is output as an image by an image output unit 5.
The JPEG scheme has been used widely as the image encoding and decoding method in an image processing apparatus of the kind described above. FIG. 19B is a diagram showing the basic construction of the image encoder 2, which performs encoding in accordance with the JPEG standard. If the input image data is a color data, the image data is subjected to a predetermined color-space transformation and subsampling and the resulting image data is input to a discrete cosine transformation unit 201a. The latter subjects the input image data to a discrete cosine transform in units of a predetermined block size and outputs the transformation coefficients to a quantizer 202a. The latter quantizes the input transformation coefficients at a predetermined quantization step and outputs the resulting image data to an entropy encoder 203a. This encoder subjects the quantized coefficients to Huffman coding and outputs a code stream.
In accordance with the scheme described above, image data is compressed at a comparatively high compression rate and the compressed data is stored in the memory 3. The compression rate is adjusted by the quantization step of the quantizer 202a. However, since the output of the entropy encoder 203a is a variable-length code, the length of the data that has been encoded varies in dependence upon the input image data even though the quantization step is held at a constant value. In the image processing apparatus shown in FIG. 19A, therefore, a problem which arises is that the amount of memory capacity needed for memory 3 cannot be decided by processing based upon a fixed quantization step.
Accordingly, in order to arrange it so that the memory 3 can positively accommodate a code stream obtained by compressing and encoding an image, it is necessary to decide the memory capacity by anticipating the minimum compression rate assumed to be applied or to decide the memory capacity by compressing the image data while varying the quantization step, and then changing the quantization step dynamically, in conformity with the image data to be processed, in such a manner that the code stream will fit into the memory 3. With the former approach, however, the cost of the apparatus is raised by providing a large memory capacity. With the latter expedient, processing is complicated and a plurality of trial runs are necessary in order to decide upon a proper value for the quantization step. The end result is prolonged processing time.